#!/usr/bin/env bash

for t in $(hive -e 'show tables')
do
  t_desc=$(hive -e "desc ${t}")
  if [[ $t_desc == *stationid* ]];then
    hive -e "ALTER TABLE ${t} CHANGE stationid stationid char(10);"
  elif [[ $t_desc == *station_id* ]];then
    hive -e "ALTER TABLE ${t} CHANGE station_id station_id char(10);"
  fi
done